<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<html>
<head>
    <meta charset="UTF-8">
    <title>宾客要求管理</title>
    <link rel="stylesheet" type="text/css" href="css/manhuaDate.1.0.css"/>
    <!--<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>-->
    <link rel="stylesheet" type="text/css" href="css/hotel.css"/>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/manhuaDate.1.0.js"></script>
    <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="layer/layer.js"></script>
    <script type="text/javascript">
        $(function () {
            $("input.mh_date").manhuaDate({
                Event: "click",//可选
                Left: 0,//弹出时间停靠的左边位置
                Top: -332,//弹出时间停靠的顶部边位置
                fuhao: "-",//日期连接符默认为-
                isTime: false,//是否开启时间值默认为false
                beginY: 1949,//年份的开始默认为1949
                endY: 2100//年份的结束默认为2049
            });
        });
    </script>
</head>
<body class="guestroom-body">
<input type="hidden" id="GuserName" th:value="${session.UserName}"/>
<input type="hidden" id="UserStatusid" th:value="${session.UserStatusid}"/>
<input type="hidden" id="UserType" th:value="${session.UserType}"/>
<script type="text/javascript">
    var uname = $('#GuserName').val();
    if(uname == ''){
        window.location.href = "toLogin.do";
    }
    var ustatusid = $('#UserStatusid').val();
    if(ustatusid == 1){
        window.location.href = "toDecode.do";
    }
    var UserType = $('#UserType').val();
    if(UserType === '经理'){
        window.location.href = "toStatement.do";
    }
</script>
<div class="guestroom">
    <div class="guestroom-button">
        <ul>
            <li>
                <form action="" method="post">
                    <input type="text" id="selectroomid" placeholder="请输入房号"/>
                    <button type="button" id="selectbtn">查询</button>
                </form>
            </li>
            <!--<li><a href="#" class="out-room">退房</a></li>-->
            <!--<li><a href="#" class="continue-room">续房</a></li>-->
            <!--<li><a href="#" class="exchange-room">换房</a></li>-->
        </ul>
    </div>
</div>
<div class="guestroom-consume">
    <div class="guestroom-consume1">生活用品</div>
    <div class="guestroom-detail1">
        <a href="javascript:;" onclick="consume11()"  class="life1">牙刷</a>
        <a href="javascript:;" onclick="consume12()"  class="life2">毛巾</a>
        <a href="javascript:;" onclick="consume13()"  class="life3">牙膏</a>
        <a href="javascript:;" onclick="consume14()"  class="life4">洗发水</a>
        <a href="javascript:;" onclick="consume15()"  class="life5">沐浴露</a>
    </div>
    <div class="guestroom-consume2">水果</div>
    <div class="guestroom-detail2">
        <a href="javascript:;" onclick="consume21()"  class="fruit1">苹果</a>
        <a href="javascript:;" onclick="consume22()"  class="fruit2">香蕉</a>
        <a href="javascript:;" onclick="consume23()"  class="fruit3">橙子</a>
        <a href="javascript:;" onclick="consume24()"  class="fruit4">西瓜</a>
        <a href="javascript:;" onclick="consume25()"  class="fruit5">葡萄</a>
    </div>
    <div class="guestroom-consume3">蛋糕</div>
    <div class="guestroom-detail3">
        <a href="javascript:;" onclick="consume31()"  class="cake1">早餐蛋糕</a>
        <a href="javascript:;" onclick="consume32()"  class="cake2">生日蛋糕</a>
        <a href="javascript:;" onclick="consume33()"  class="cake3">奶酪蛋糕</a>
    </div>
    <div class="guestroom-consume4">酒</div>
    <div class="guestroom-detail4">
        <a href="javascript:;" onclick="consume41()"  class="wine1">啤酒</a>
        <a href="javascript:;" onclick="consume42()"  class="wine2">红酒</a>
        <a href="javascript:;" onclick="consume43()"  class="wine3">白酒</a>
        <a href="javascript:;" onclick="consume44()"  class="wine4">鸡尾酒</a>
    </div>
    <div class="guestroom-consume5">饮料</div>
    <div class="guestroom-detail5">
        <a href="javascript:;" onclick="consume51()"  class="drinks1">橙汁</a>
        <a href="javascript:;" onclick="consume52()"  class="drinks2">可乐</a>
        <a href="javascript:;" onclick="consume53()"  class="drinks3">咖啡</a>
        <a href="javascript:;" onclick="consume54()"  class="drinks4">盐汽水</a>
    </div>
</div>
<div class="guestroom-consume-detail">
    <table>
        <thead>
            <tr>
                <td width="60px">编号</td>
                <td width="60px">房号</td>
                <td width="120px">消费商品</td>
                <td width="120px">商品单价</td>
                <td width="120px">商品数量</td>
                <td width="120px">打折比例</td>
                <td width="100px">总计</td>
            </tr>
        </thead>
        <tbody id="guestroomConsumeTbody">

        </tbody>
    </table>
    <div class="guestroomConsume-center">
        <ul class="pagination" id="gcPage">

        </ul>
        共<span id="gctotalPage"></span>页
    </div>
</div>
<div class="guestroom-detail">
    <table>
        <thead>
            <tr>
                <td width="100px">房号</td>
                <td width="100px">住客</td>
                <td width="100px">房间类型</td>
                <td width="100px">房间状态</td>
                <td width="100px">入住时间</td>
                <td width="100px">退房时间</td>
                <td width="100px">操作</td>
            </tr>
        </thead>
        <tbody id="guestroomTbody">

        </tbody>
    </table>
    <div class="guestroom-center">
        <ul class="pagination" id="gpage">

        </ul>
        共<span id="gtotalPage"></span>页
    </div>
</div>
<div class="guestroom-consume-window">
    <div class="close-window">
        消费订单<a href="#" class="closebutton">X</a>
    </div>
    <div class="window-content">
        <form method="post" action="buyCommodity.do">
            <div class="guestroom-text">
                <ul>
                    <li>房间号:</li>
                    <li>消费商品:</li>
                    <!--<li>押金:</li>-->
                    <!--<li>电话号码:</li>-->
                    <li>商品单价:</li>
                    <li>商品数量:</li>
                    <!--<li>打折比例:</li>-->
                    <li>消费时间:</li>
                    <!--<li class="last">备注:</li>-->
                </ul>
            </div>
            <div class="guestroom-input">
                <ul>
                    <li>
                        <input type="text" name="consumeRoomid"/>
                    </li>
                    <li><input type="text" id="consumeName" name="consumeName" readonly="readonly"/></li>
                    <!--<li><input type="text"/></li>-->
                    <!--<li><input type="text"/></li>-->
                    <li><input type="text" id="consumePrice" name="consumePrice" readonly="readonly"/></li>
                    <li><input type="number" name="consumeNumber"/></li>
                    <!--<li><input type="text" readonly="readonly"/></li>-->
                    <li><input class="mh_date" name="consumeTime" type="text" readonly="true"/></li>
                    <!--<li class="last"><textarea></textarea></li>-->
                </ul>
            </div>
            <div class="btnguestroom">
                <button class="btn-guestroom">确定</button>
                <button class="guestroom-cancel" type="button">取消</button>
            </div>
        </form>
    </div>
</div>
<div class="out-window">
    <div class="close-window">
        退房<a href="#" class="closebutton">X</a>
    </div>
    <div class="window-content">
        <form method="post" action="">
            <div class="guestroom-text">
                <ul>
                    <li>房间类型:</li>
                    <li>房间号:</li>
                    <li><label for="userName">姓名:</label></li>
                    <li><label for="Identity">身份证:</label></li>
                </ul>
            </div>
            <div class="guestroom-input">
                <ul>
                    <li>
                        <select>
                            <option>单人间</option>
                            <option>标准间</option>
                            <option>双人间</option>
                            <option>豪华套房</option>
                            <option>总统套房</option>
                        </select>
                    </li>
                    <li>
                        <select></select>
                    </li>
                    <li><input type="text" id="userName"/></li>
                    <li><input type="text" id="Identity"/></li>
                </ul>
            </div>
            <div class="btnguestroom">
                <button class="btn-guestroom">确定</button>
                <button class="guestroom-cancel" type="button">取消</button>
            </div>
        </form>
    </div>
</div>
<div class="continue-window">
    <div class="close-window">
        续房<a href="#" class="closebutton">X</a>
    </div>
    <div class="window-content">
        <form method="post" action="">
            <div class="guestroom-text">
                <ul>
                    <li><label for="outRoomTime">退房时间:</label></li>
                </ul>
            </div>
            <div class="guestroom-input">
                <ul>
                    <li><input class="mh_date" type="text" readonly="true" id="outRoomTime"/></li>
                </ul>
            </div>
            <div class="btnguestroom">
                <button class="btn-guestroom" type="button" id="btnguestroom">确定</button>
                <button class="guestroom-cancel" type="button">取消</button>
            </div>
        </form>
    </div>
</div>
<div class="exchange-window">
    <div class="close-window">
        换房<a href="#" class="closebutton">X</a>
    </div>
    <div class="window-content">
        <form method="post" action="">
            <div class="guestroom-text">
                <ul>
                    <li>房间类型:</li>
                    <li>房间号:</li>
                    <li><label for="userName2">姓名:</label></li>
                    <li><label for="Identity2">身份证:</label></li>
                </ul>
            </div>
            <div class="guestroom-input">
                <ul>
                    <li>
                        <select>
                            <option>单人间</option>
                            <option>标准间</option>
                            <option>双人间</option>
                            <option>豪华套房</option>
                            <option>总统套房</option>
                        </select>
                    </li>
                    <li>
                        <select></select>
                    </li>
                    <li><input type="text" id="userName2"/></li>
                    <li><input type="text" id="Identity2"/></li>
                </ul>
            </div>
            <div class="btnguestroom">
                <button class="btn-guestroom">确定</button>
                <button class="guestroom-cancel" type="button">取消</button>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $(".guestroom-consume-window").hide();
        $(".out-window").hide();
        $(".continue-window").hide();
        $(".exchange-window").hide();
    });
    $(".guestroom-consume a").click(function () {
        $(".guestroom-consume-window").show();
    });
    $(".out-room").click(function () {
        $(".out-window").show();
    });
    $(".continue-room").click(function () {
        $(".continue-window").show();
    });
    $(".exchange-room").click(function () {
        $(".exchange-window").show();
    });
    $(".closebutton").click(function () {
        $(".guestroom-consume-window").hide();
        $(".out-window").hide();
        $(".continue-window").hide();
        $(".exchange-window").hide();
    });
    $(".guestroom-cancel").click(function () {
        $(".guestroom-consume-window").hide();
        $(".out-window").hide();
        $(".continue-window").hide();
        $(".exchange-window").hide();
    })
    function consume11(){
        var id = "life1";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume12(){
        var id = "life2";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume13(){
        var id = "life3";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume14(){
        var id = "life4";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume15(){
        var id = "life5";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume21(){
        var id = "fruit1";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume22(){
        var id = "fruit2";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume23(){
        var id = "fruit3";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume24(){
        var id = "fruit4";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume25(){
        var id = "fruit5";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume31(){
        var id = "cake1";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume32(){
        var id = "cake2";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume33(){
        var id = "cake3";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume41(){
        var id = "wine1";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume42(){
        var id = "wine2";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume43(){
        var id = "wine3";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume44(){
        var id = "wine4";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume51(){
        var id = "drinks1";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume52(){
        var id = "drinks2";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume53(){
        var id = "drinks3";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function consume54(){
        var id = "drinks4";
        $.post(
            "Consume.do",
            {"id":id},
            function (data){
                if (data.status == 0){
                    var commodity = data.result;
                    $('#consumeName').val(commodity.commodityName);
                    $('#consumePrice').val(commodity.commodityPrice);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    var recordPage;
    findByPage(1);
    var selectroomid;
    function findByPage(page){
        $('#guestroomConsumeTbody').empty();
        var currentPage = page;
        $.post(
            "guestroomConsumeList.do",
            {'currentPage': currentPage,'selectroomid':selectroomid},
            function (data){
                if (data.status == 0){
                    var pageBean = data.result;
                    var totalPage = pageBean.totalPage;
                    var guestroomConsumeList = pageBean.lists;
                    var no = pageBean.pageSize * (currentPage - 1);
                    for (var i = 0;i<guestroomConsumeList.length;i++){
                        $('#guestroomConsumeTbody').append('<tr>' +
                                '<td width="60px">'+(no+1+i)+'</td>'+
                                '<td width="60px">'+guestroomConsumeList[i].consumeRoomid+'</td>'+
                                '<td width="120px">'+guestroomConsumeList[i].consumeName+'</td>'+
                                '<td width="120px">'+guestroomConsumeList[i].consumePrice+'</td>'+
                                '<td width="120px">'+guestroomConsumeList[i].consumeNumber+'</td>'+
                                '<td width="120px">'+guestroomConsumeList[i].vip.vipDiscount+'</td>'+
                                '<td width="100px">'+(guestroomConsumeList[i].consumePrice*guestroomConsumeList[i].consumeNumber*guestroomConsumeList[i].vip.vipDisDouble)+'</td>'+
                            '</tr>');
                    }
                    $('#gcPage').empty();
                    var begin = 1;
                    var end = 1;
                    if (totalPage <= 5) {
                        begin = 1;
                        end = totalPage;
                    } else {
                        begin = currentPage - 2;
                        end = currentPage + 2;
                        if (begin <= 1) {
                            begin = 1;
                            end = 5;
                        }
                        if (end >= totalPage) {
                            begin = totalPage - 4;
                            end = totalPage;
                        }
                    }
                    //添加上一页的按钮
                    $('#gcPage').append('<li id="left" class="" style="display: inline-block;border: 1px solid blue;width: 20px;height: 20px"><span onclick="findByPage(' + (currentPage - 1) + ')" >&laquo;</span></li>');
                    //添加中间的页数
                    for (var i = begin; i <= end; i++) {
                        $('#gcPage').append('<li class="" style="display: inline-block;border: 1px solid blue;width: 20px;height: 20px"><a onclick="findByPage(' + i + ')">' + i + '</a></li>');
                    }
                    //添加下一页的按钮
                    $('#gcPage').append('<li id="right" class="" style="display: inline-block;border: 1px solid blue;width: 20px;height: 20px"><span onclick="findByPage(' + (currentPage + 1) + ')" >&raquo;</span></li>');
                    if (currentPage == 1) {
                        //添加禁用样式
                        $('#left').addClass('disabled');
                        //清除点击事件
                        $('#left>span').removeAttr('onclick');
                    }
                    if (currentPage == totalPage) {
                        //添加禁用样式
                        $('#right').addClass('disabled');
                        //清除点击事件
                        $('#right>span').removeAttr('onclick');
                    }
                    //添加当前页的激活样式
                    $('#gcPage>li').eq(currentPage - begin + 1).addClass('selectPage');
                    //显示总页数
                    $('#gctotalPage').html(totalPage);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    $('#selectbtn').click(function (){
        selectroomid = $('#selectroomid').val();
        findByPage(1);
        findByPage1(1);
    })
    findByPage1(1);
    function findByPage1(page){
        $('#guestroomTbody').empty();
        var currentPage = page;
        recordPage = currentPage;
        $.post(
            "guestroomList.do",
            {'currentPage': currentPage,'selectroomid':selectroomid},
            function (data){
                if (data.status == 0){
                    var pageBean = data.result;
                    var totalPage = pageBean.totalPage;
                    var guestroomList = pageBean.lists;
                    var no = pageBean.pageSize * (currentPage - 1);
                    for(var i=0;i<guestroomList.length;i++){
                        $('#guestroomTbody').append('<tr>' +
                                '<input type="hidden" value="'+guestroomList[i].roomId+'"/>'+
                                '<input type="hidden" value="'+guestroomList[i].roomName+'"/>'+
                                '<td width="100px">'+guestroomList[i].roomId+'</td>'+
                                '<td width="100px">'+guestroomList[i].roomName+'</td>'+
                                '<td width="100px">'+guestroomList[i].roomType+'</td>'+
                                '<td width="100px">'+guestroomList[i].roomState+'</td>'+
                                '<td width="100px">'+guestroomList[i].roomIn+'</td>'+
                                '<td width="100px">'+guestroomList[i].roomOut+'</td>'+
                                '<td width="100px"><a href="javascript:;" onclick="continueRoom(this)" class="continue-room">续房</a></td>'+
                            '</tr>');
                    }
                    $('#gpage').empty();
                    var begin = 1;
                    var end = 1;
                    if (totalPage <= 5) {
                        begin = 1;
                        end = totalPage;
                    } else {
                        begin = currentPage - 2;
                        end = currentPage + 2;
                        if (begin <= 1) {
                            begin = 1;
                            end = 5;
                        }
                        if (end >= totalPage) {
                            begin = totalPage - 4;
                            end = totalPage;
                        }
                    }
                    //添加上一页的按钮
                    $('#gpage').append('<li id="left" class="" style="display: inline-block;border: 1px solid blue;width: 20px;height: 20px"><span onclick="findByPage1(' + (currentPage - 1) + ')" >&laquo;</span></li>');
                    //添加中间的页数
                    for (var i = begin; i <= end; i++) {
                        $('#gpage').append('<li class="" style="display: inline-block;border: 1px solid blue;width: 20px;height: 20px"><a onclick="findByPage1(' + i + ')">' + i + '</a></li>');
                    }
                    //添加下一页的按钮
                    $('#gpage').append('<li id="right" class="" style="display: inline-block;border: 1px solid blue;width: 20px;height: 20px"><span onclick="findByPage1(' + (currentPage + 1) + ')" >&raquo;</span></li>');
                    if (currentPage == 1) {
                        //添加禁用样式
                        $('#left').addClass('disabled');
                        //清除点击事件
                        $('#left>span').removeAttr('onclick');
                    }
                    if (currentPage == totalPage) {
                        //添加禁用样式
                        $('#right').addClass('disabled');
                        //清除点击事件
                        $('#right>span').removeAttr('onclick');
                    }
                    //添加当前页的激活样式
                    $('#gpage>li').eq(currentPage - begin + 1).addClass('selectPage');
                    //显示总页数
                    $('#gtotalPage').html(totalPage);
                }else {
                    layer.msg(data.message);
                }
            }
        );
    }
    function continueRoom(btn){
        var $tds = $(btn).parent().siblings();
        var roomid = $($tds[0]).val();
        var roomName = $($tds[1]).val();
        $(".continue-window").show();
        $('#btnguestroom').click(function (){
            var outRoomTime = $('#outRoomTime').val();
            $.post(
                "continueGuestroom.do",
                {'roomid':roomid,'roomName':roomName,'outRoomTime':outRoomTime},
                function (data){
                    if (data.status == 0){
                        $(".continue-window").hide();
                        findByPage1(recordPage);
                    }else {
                        layer.msg(data.message);
                    }
                }
            );
        });
    }
</script>
</body>
</html>
